package main

import (
	"fmt"
	"go.uber.org/zap"
	"zzqedu/global"
	"zzqedu/initialize"
)

func main() {
	fmt.Print("hello zzqedu")

	//初始化日志配置
	initialize.InitLogger()

	//初始化配置信息
	initialize.InitConfig()

	//初始化数据库连接
	initialize.InitDB()

	//
	initialize.InitService()

	//初始化路由配置
	router := initialize.InitRouter()

	//启动gin服务
	httpPort := global.ServerConfig.Port
	zap.S().Infof("项目启动的端口是port:%v", httpPort)
	err := router.Run(fmt.Sprintf(":%d", httpPort))
	if err != nil {
		zap.S().Errorf("项目启动失败")
	}

}
